package com.qindian.coupontest;

import java.security.MessageDigest;

/**
 * Author: Li
 * Date: 2018/4/28 0028
 * Description:
 */

public class MD5Util {
    public static String getMD5(String var0) {
        byte[] var7;
        try {
            var7 = MessageDigest.getInstance("MD5").digest(var0.getBytes("UTF-8"));
        } catch (Exception var6) {
            var6.printStackTrace();
            return null;
        }

        StringBuilder var1 = new StringBuilder(var7.length << 1);
        byte[] var4 = var7;
        int var3 = var7.length;

        for(int var2 = 0; var2 < var3; ++var2) {
            byte var8;
            if(((var8 = var4[var2]) & 255) < 16) {
                var1.append("0");
            }

            var1.append(Integer.toHexString(var8 & 255));
        }

        return var1.toString();
    }
}
